<?php
if (!defined('BASEPATH'))
    exit('no direct script allowed asshole!!');
$this->load->helper('html');
?>



<!-- JavaScript -->
<script type="text/javascript" src="<?= base_url() ?>js/wufoo.js"></script>
<script src="<?= base_url() ?>js/jscal2.js"></script>
<script src="<?= base_url() ?>js/lang/en.js"></script>

<!-- CSS -->
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/form/form.css" media="screen, tv, projection" title="Default" />
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/jscal2.css" />
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/border-radius.css" />
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/steel/steel.css" />

 

<div id="container">
    <fieldset class="fieldset">
        <legend class="legend">

		<?
		if ($status == "detail") {
		echo '| Detail Data Proyek |</legend>';
		} else if ($status == "edit") {
		echo '| Edit Data Proyek |</legend>';
		}
		else {
		echo '| Form Data Proyek |</legend>';
		}
		?>

        <div id="contentform" style="border:solid thin #BBBBBB; height:350px; background-color:#F9F9F9; -moz-border-radius: 5px;  padding-top:10px; padding-bottom:0.3px; margin-right:100px; margin-left:100px;">

            <!-- Start value -->
            <?
            //Setting Value Jika Prosedur yang dilakukan adalah prosedur input biasa.
            $value = array(
                'ID_PROYEK' => "",
                'NAMA_PROYEK' => "",
                'NOMOR_KONTRAK' => "",
                'OWNER' => "",
				'ID_PEGAWAI' => "",
                'JENIS_KAPAL' => "",
                'KECEPATAN' => "",
                'PANJANG' => "",
                'LEBAR' => "",
                'TINGGI' => "",
                'SARAT' => "",
                'RUTE_PELAYARAN' => "",
                'TANGGAL_MULAI_PROYEK' => "",
				'TANGGAL_SELESAI_PROYEK' => "",
				'STATUS_PROYEK' => "",
				'act_form' => "proyek/upload/"
            );
			
            //Setting Value pada form Jika melakukan prosedur Edit terhadap data tertentu.
            if ($status == "edit") {
                $value['ID_PROYEK'] = $ID_PROYEK;
                $value['NAMA_PROYEK'] = $NAMA_PROYEK;
                $value['NOMOR_KONTRAK'] = $NOMOR_KONTRAK;
                $value['OWNER'] = $OWNER;
				$value['ID_PEGAWAI'] = $ID_PEGAWAI;
                $value['JENIS_KAPAL'] = $JENIS_KAPAL;
                $value['KECEPATAN'] = $KECEPATAN;
                $value['PANJANG'] = $PANJANG;
                $value['LEBAR'] = $LEBAR;
                $value['TINGGI'] = $TINGGI;
                $value['SARAT'] = $SARAT;
                $value['RUTE_PELAYARAN'] = $RUTE_PELAYARAN;
                $value['TANGGAL_MULAI_PROYEK'] = $TANGGAL_MULAI_PROYEK;
				$value['TANGGAL_SELESAI_PROYEK'] = $TANGGAL_SELESAI_PROYEK;
				$value['STATUS_PROYEK'] = $STATUS_PROYEK;
				$value['act_form'] = "proyek/update/" . $value['ID_PROYEK'];
            }//end if
            ?>

            <?= form_open_multipart($value["act_form"]); ?>
           
            <!-- End value -->

            <table width="847" border="0" bordercolor="#F0F0F0">
                <tr>
                    <td width="905" height="150">
                        <form id="form1" name="form1" method="post">
                            <div align="center">
                                <table width="850" border="0">                                 
								
									<tr>
                                        <td width="180">Nama Proyek</td>
                                        <td width="208"><input name="NAMA_PROYEK" type="text" size="50" value="<?= $value['NAMA_PROYEK'] ?>"/></td>
                                        <td><? echo form_error('NAMA_PROYEK');?></td>
                                    </tr>                    
									<tr>
                                        <td width="180">Nomer Kontrak</td>
                                        <td width="208"><input name="NOMOR_KONTRAK" type="text" size="50" value="<?= $value['NOMOR_KONTRAK'] ?>"/></td>
                                        <td><? echo form_error('NOMOR_KONTRAK');?></td>
                                    </tr>                                 
									<tr>
                                        <td width="180">Owner</td>
                                        <td width="208"><input name="OWNER" type="text" size="50" value="<?= $value['OWNER'] ?>"/></td>
                                        <td><? echo form_error('OWNER');?></td>
                                    </tr>						
									<tr>
                                        <td>Nama Pegawai yang Bertanggung Jawab</td>
                                		<td>
										<?
											$options[Null] = "-- Daftar Pegawai --";
											foreach ($pegawai->result() as $row)
											{
												$options[$row->ID_PEGAWAI] = $row->NAMA_PEGAWAI;
											}
											echo form_dropdown('ID_PEGAWAI', $options, $value["ID_PEGAWAI"], 'class="field select"');
											if ($status=="detail")
											{
												echo form_dropdown('ID_PEGAWAI', $options, $value["ID_PEGAWAI"], 'class="field select" id="ID_PEGAWAI"');
											}
										?>
										
										</td>										
                                        <td><? echo form_error('ID_PEGAWAI');?></td>
                                    </tr>                                 
									<tr>
                                        <td width="180">Jenis_Kapal</td>
                                        <td width="208"><input name="JENIS_KAPAL" type="text" size="50" value="<?= $value['JENIS_KAPAL'] ?>"/></td>
                                        <td><? echo form_error('JENIS_KAPAL');?></td>
                                    </tr>                                 
									<tr>
                                        <td width="180">Kecepatan</td>
                                        <td width="208"><input name="KECEPATAN" type="text" size="50" value="<?= $value['KECEPATAN'] ?>"/></td>
                                        <td><? echo form_error('KECEPATAN');?></td>
                                    </tr>                                 
									<tr>
                                        <td width="180">Panjang</td>
                                        <td width="208"><input name="PANJANG" type="text" size="50" value="<?= $value['PANJANG'] ?>"/></td>
                                        <td><? echo form_error('PANJANG');?></td>
                                    </tr>                                 
									<tr>
                                        <td width="180">Lebar</td>
                                        <td width="208"><input name="LEBAR" type="text" size="50" value="<?= $value['LEBAR'] ?>"/></td>
                                        <td><? echo form_error('LEBAR');?></td>
                                    </tr>                                 
									<tr>
                                        <td width="180">Tinggi</td>
                                        <td width="208"><input name="TINGGI" type="text" size="50" value="<?= $value['TINGGI'] ?>"/></td>
                                        <td><? echo form_error('TINGGI');?></td>
                                    </tr>                                 
									<tr>
                                        <td width="180">Sarat</td>
                                        <td width="208"><input name="SARAT" type="text" size="50" value="<?= $value['SARAT'] ?>"/></td>
                                        <td><? echo form_error('SARAT');?></td>
                                    </tr>                                 
									<tr>
                                        <td width="180">Rute_Pelayaran</td>
                                        <td width="208"><input name="RUTE_PELAYARAN" type="text" size="50" value="<?= $value['RUTE_PELAYARAN'] ?>"/></td>
                                        <td><? echo form_error('RUTE_PELAYARAN');?></td>
                                    </tr>
									<tr>
                                        <td width="80">Tanggal Mulai Proyek</td>
                                        <td width="108"><input id="TANGGAL_MULAI_PROYEK" name="TANGGAL_MULAI_PROYEK" readonly="true" size="20" value="<?= $value['TANGGAL_MULAI_PROYEK'] ?>"/><input id="f_btn1" type="button" name="Submit22" value="" onclick="TANGGAL_MULAI_PROYEK.value=''"/></td>
										<td><? echo form_error('TANGGAL_MULAI_PROYEK');?></td>
									</tr>
									<tr>
                                        <td width="80">Tanggal Selesai Proyek</td>
                                        <td width="108"><input id="TANGGAL_SELESAI_PROYEK" name="TANGGAL_SELESAI_PROYEK" readonly="true" size="20" value="<?= $value['TANGGAL_SELESAI_PROYEK'] ?>"/><input id="f_btn2" type="button" name="Submit22" value="" onclick="TANGGAL_SELESAI_PROYEK.value=''"/></td>
										<td><? echo form_error('TANGGAL_SELESAI_PROYEK');?></td>
									</tr>
									<tr>
                                        <td width="80">Status Proyek</td>
										<td width="208">
										<?php 
											$pilihan_jk = array(
											Null => '-- Pilih Status --',
											'Aktif' => 'Aktif',
											'Tidak aktif' => 'Tidak aktif'
											);
											
											if ($status == "edit"){
											echo form_dropdown('STATUS_PROYEK',$pilihan_jk,$STATUS_PROYEK, 'class="field select"');
											}
											else {
											echo form_dropdown('STATUS_PROYEK',$pilihan_jk,  'class="field select"');
											}
										
										?>
										</td>
										<td><? echo form_error('STATUS_PROYEK');?></td>
									</tr>
									
								                                  
                                    <tr>
                                        <td height="28">&nbsp;</td>
                                        <td>
                                            <div align="left">
                                                <input type="submit" name="Submit" value="Simpan" />
												<a href="<?php echo site_url('proyek/index') ?>">
												<input type="button" value="Kembali" />
												</a>

												
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </form>
                        <p align="center">&nbsp;</p></td></tr>
            </table>
        </div>
        <p>&nbsp;</p>
		
		<script type="text/javascript">//<![CDATA[

      var cal = Calendar.setup({
          onSelect: function(cal) { cal.hide() }
      });
      cal.manageFields("f_btn1", "TANGGAL_MULAI_PROYEK", "%Y-%m-%d");
	  cal.manageFields("f_btn2", "TANGGAL_SELESAI_PROYEK", "%Y-%m-%d");

    //]]></script>
		
    </fieldset>
</div>
<p>
    <!--container-->
</p>
<p>&nbsp; </p>

